package org.alanlau.cloud.consumermoviefeign.controller;

import org.alanlau.cloud.consumermoviefeign.entity.User;
import org.alanlau.cloud.consumermoviefeign.feign.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Movie控制器
 *
 * @author liukun
 * @version 1.0
 * @date 2019/10/9 11:39
 */
@RequestMapping("/movies")
@RestController
public class MovieController {
    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/users/{id}")
    public User findById(@PathVariable Long id) {
        // ...电影微服务的业务...

        return userFeignClient.findById(id);
    }
}
